Greek mercenaries were used as heavy infantry, usually fighting in a phalanx formation with javelins, daggers and thrusting swords. As a result of a treaty between the Macedonian king and Hannibal, four thousand Macedonians also fought for Carthage, participating in their decisive defeat at Zama in 202 BC.